﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tasks.Common.Enum;

namespace Tasks.Common.Entitys
{
    public class TicketGroupStorage
    {
        #region ID

        private Int32 m_iD;

        /// <summary>Gets or sets ID</summary>
        public Int32 ID
        {
            get { return m_iD; }
            set { m_iD = value; }
        }

        #endregion

        #region CardNo1

        private String m_cardNo1;

        /// <summary>Gets or sets CardNo1</summary>
        public String CardNo1
        {
            get { return m_cardNo1; }
            set { m_cardNo1 = value; }
        }

        #endregion

        #region CardNo2

        private String m_cardNo2;

        /// <summary>Gets or sets CardNo2</summary>
        public String CardNo2
        {
            get { return m_cardNo2; }
            set { m_cardNo2 = value; }
        }

        #endregion

        #region CreateTime

        private DateTime m_createTime;

        /// <summary>Gets or sets CreateTime</summary>
        public DateTime CreateTime
        {
            get { return m_createTime; }
            set { m_createTime = value; }
        }

        #endregion

        #region CreateUserID

        private Int32 m_createUserID;

        /// <summary>Gets or sets CreateUserID</summary>
        public Int32 CreateUserID
        {
            get { return m_createUserID; }
            set { m_createUserID = value; }
        }

        #endregion

        #region State

        private Int32 m_state;

        /// <summary>Gets or sets State</summary>
        public Int32 State
        {
            get { return m_state; }
            set { m_state = value; }
        }

        #endregion
        public string CreateUserName { get; set; }
        public int CardCount()
        {
            if (string.IsNullOrWhiteSpace(this.CardNo2))
            {
                return 1;
            }
            return (Convert.ToInt32(this.CardNo2) - Convert.ToInt32(this.CardNo1)) + 1;
        }
        public string ToStateStr()
        {
            return CommonUtil.GetEnumDescription(typeof(TicketGroupStorageState), this.State);
        }
    }
}
